﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint;

namespace Redirection.Helpers
{
    public static class ListHelper
    {
        public static DateTime LastModified(SPList list)
        {
            if (list == null) return DateTime.MinValue;

            var modified = list.LastItemModifiedDate;

            if (list.LastItemDeletedDate > modified)
            {
                modified = list.LastItemDeletedDate;
            }
            
            return modified.ToUniversalTime();
        }
    }
}
